<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			function Foo() {

				getName = function() {
					console.log(1)
				}

				return this

			}

			Foo.getName = function() {
				console.log(2)
			}

			Foo.prototype.getName = function() {
				console.log(3)
			}

			var getName = function() {
				console.log(4)
			}

			function getName() {
				console.log(5)
			}
			
			
			Foo.getName() //console.log(2)
			getName()    //console.log(4)
			Foo().getName() //console.log(1)
			getName(); //console.log(1)
			
			new Foo.getName() //console.log(2)
			new Foo().getName() //console.log(3)
			new new Foo().getName(); //new b.getName() //console.log(3)
			
		</script>
	</body>
</html>
